package com.test.shiro;

import com.alibaba.fastjson.JSONObject;
import com.fzdy.product.base.vo.FrontPage;
import com.fzdy.product.controller.api.OrderApi;
import com.fzdy.product.dao.UserDao;
import com.fzdy.product.entity.Role;
import com.fzdy.product.entity.User;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

public class test {

    UserDao userDao;
    public JSONObject getOrderList(@RequestBody FrontPage<OrderApi> page) {
        User user=new User();
        user.setName("xiaozhuang");
        Page<User> a = userDao.findAll(Example.of(user), PageRequest.of(0, 5));
        Role role=new Role();
        role.setName("admin");
        user.setRole(role);
        Page<User> b = userDao.findAll(Example.of(user), PageRequest.of(0, 5));
        JSONObject resobj=new JSONObject();
        resobj.put("statusCode",200);
        resobj.put("message","您拥有管理员权限，可以获得该接口的信息！");
        return resobj;
    }

    public static void main(String[] args) {
        String aa="asdfsadf";
        System.out.println(aa.replaceAll("a","f"));

    }
}
